package com.qc31.monitorlib.uitls

/**
 * 颜色工具
 */
object ColorUtil {
    private val plateColors = HashMap<String, String>()

    /**
     * 初始化车牌颜色
     */
    fun initPlateColorMap() {
        if (plateColors.isNotEmpty()) return
        plateColors["1"] =  "#0523ee"
        plateColors["2"] =  "#fbbb07"
        plateColors["3"] =  "#060102"
        plateColors["4"] =  "#fafbf8"
        plateColors["5"] =  "#019166"
        plateColors["9"] =  "#b9b9b9"
        plateColors["91"] = "#fbbb07"
        plateColors["92"] = "#019166"
    }

    /**
     * 获取车牌颜色
     */
    fun getPlateColor(key: String): String {
        return plateColors[key] ?: "#0523ee"
    }

    fun getPlateTextColor(key: String):String{
        return when(key){
            "1","3","5"-> "#ffffff"
            else-> "#111111"
        }
    }
}